
%\documentclass[letterpaper,12pt]{article}
%\usepackage[x11names,rgb]{xcolor}
%\usepackage{tikz}
%\usetikzlibrary{snakes}
%\usetikzlibrary{arrows}
%\usetikzlibrary{shapes}
%\usetikzlibrary{backgrounds}
%\usepackage{amsmath}
%\oddsidemargin 0in
%\evensidemargin 0in
%\topmargin 0in
%\headheight 0in
%\headsep 0in
%\textheight 9in
%\textwidth 6.5in
%\begin{document}
%\pagestyle{empty}
%\vspace*{\fill}
%\begin{center}
\documentclass{article}
 
\usepackage[pdftex,active,tightpage]{preview}
\usepackage{tikz}
\usetikzlibrary{snakes}
\usetikzlibrary{arrows}
\makeatletter
 
\begin{document}
\begin{preview}
	%%
	\begin{tikzpicture}[scale=0.6]
	    	% the octant in question ...
	    	\draw[fill=red!30] (1,1) rectangle (5,5);
	    	%% its insulation zone ...
	    	\draw[gray, very thin] (1,1) rectangle +(8,8);
	    	%% stage 1 octants ...
	    	\draw[fill=orange!80!black] (5,5) rectangle +(2,2);
	    	\draw[fill=orange!80!black] (5,3) rectangle +(2,2);
	    	\draw[fill=orange!80!black] (3,5) rectangle +(2,2);
	    	\draw[fill=orange!80!black] (2,5) rectangle +(1,1);
	    	\draw[fill=orange!80!black] (1,5) rectangle +(1,1);
	    	\draw[fill=orange!80!black] (5,2) rectangle +(1,1);
	    	\draw[fill=orange!80!black] (5,1) rectangle +(1,1);
	    	% stage 2 octants ...
	    	\draw[fill=green!30!black] (4,7) rectangle +(2,2);
	    	\draw[fill=green!30!black] (7,4) rectangle +(2,2);
	    	\draw (4,7) grid +(2,2);
	    	\draw (7,4) grid +(2,2);
	    	% inter-processor boundary 
	    	\draw[red, very thick, step=5cm] (0,0) grid (10,10);	
	    	% domain ...
	    	\draw[very thick] (0,0) rectangle (10,10);
	    	
	    	%% Label figure ...
	    		%% processor ids ...
	    		\draw (0.5,0.5) node {$p_1$} (0.5,9.5) node {$p_2$} (9.5,9.5) node {$p_3$} (9.5,0.5) node {$p_4$};
	    		%% Node label ...
	    		\draw (3,3) node {$N$};
	    		%% Insulation Zone ...
	    		\draw (12.5,3.3) node {Insulation};
		    	\draw (12.5,2.3) node {Zone};
		    	\draw[->] (11,2.6) -- (9,2.8);
		    	%% Stage 1
		    	\draw (12.4,8.2) node (s1) {Stage 1};
		    	\draw[->] (10.5, 8.2) -- (6,6);
		    	%% Stage 2
		    	\draw (12.4,6.2) node {Stage 2};
		    	\draw[->] (10.5, 6.2) -- (8.5,5.5);
	    	\end{tikzpicture}%%
\end{preview}
\end{document}

%\end{center}
%\vspace*{\fill}
%\end{document}

    	